﻿using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;

namespace SlamCms.DomainEvents
{
	public class DependencyResolverEventDispatcher : DefaultEventDispatcher
	{
		protected override IEnumerable<IDomainEventHandler<T>> GetHandlers<T>()
		{
			var handlers = DependencyResolver.Current.GetServices<IDomainEventHandler<T>>();
			return handlers.Union(base.GetHandlers<T>());
		}
	}
}
